#ifndef ENTITYPROJECTILE_H
#define ENTITYPROJECTILE_H

#include "WorldEntity.h"

//!This class represents a projectile
class CEntityProjectile : public CWorldEntity
{
private:
	//!Projectile's speed
	int m_speed;

	//!Sprite index of the projectile
	int m_indexSprite;

	//!Time the projectile is created
	int m_birthTime;

	//!Time the projectile is alive.
	static const int m_liveTime = 2000;

public:
	//!Constructor
	/*!
	\param indexTexture Index of the texture
	\param indexSprite Index of the sprite.
	\param position Initial position of the entity
	\param collide Set if the entity detects collision
	\param speed Set the speed of the entity
	*/
	CEntityProjectile(int indexTexture, int indexSprite, const CVector2i& position, bool collide, int speed);

	//!Destructor
	~CEntityProjectile();

	//!Update the projectile.
	void doUpdate(void);

	//!Render the projectile
	void doRender(void);

	//!Set the speed of the projectile
	/*!
	\param speed The new speed of the projectile.
	*/
	void setSpeed(int speed);

	//!Set the index of the sprite for the projectile
	/*!
	\param index The new sprite index.
	*/
	void setIndexSprite(int index);

	//!Set the index of the texture.
	void setIndexTexture(int index);

	int getSpeed(void);
};

#endif
